import React, { Component } from "react";
import { getService } from "../../http/api-p";

class download extends Component {
  constructor(props) {
    super(props);
    this.state = {
      users: [],
      isLoaded: false,
    };
  }

  async componentDidMount() {
    //先存一下this，以防使用箭头函数this会指向我们不希望它所指向的对象。
    const _this = this;
    let res = await getService()
    _this.setState({
        users: res,
        isLoaded: true,
      });
    console.log(res)
    console.log(_this.state.users)
  }
  render() {
    return <div></div>;
  }
}

export default download;
